package com.situ.gym.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.situ.gym.pojo.Coach;
import com.situ.gym.mapper.CoachMapper;
import com.situ.gym.pojo.query.CoachQuery;
import com.situ.gym.pojo.vo.ChartCountVO;
import com.situ.gym.service.ICoachService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author ${author}
 * @since 2025-08-22
 */
@Service
public class CoachServiceImpl extends ServiceImpl<CoachMapper, Coach> implements ICoachService {

    @Autowired
    private CoachMapper coachMapper;

    @Override
    public IPage<Coach> list(CoachQuery coachQuery) {
        IPage<Coach> page  = new Page<>(coachQuery.getPage(), coachQuery.getLimit());
        return coachMapper.list(page, coachQuery);
    }

    @Override
    public void deleteAll(Integer[] ids) {
        coachMapper.deleteAll(ids);
    }

    @Override
    public List<ChartCountVO> selectCoachCount() {
        return coachMapper.selectCoachCount();
    }
}
